package palestra.banco;

import java.awt.HeadlessException;

import javax.swing.JOptionPane;

import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class GeraBanco {

	public static void main(String[] args) {
		try {
			Configuration cfg = new Configuration();
			cfg.configure();
			SchemaExport se = new SchemaExport(cfg);
			se.create(true, true);
			JOptionPane.showMessageDialog(null,"Banco Gerado com Sucesso!");
		} catch (HeadlessException e) {
			
			e.printStackTrace();
			JOptionPane.showMessageDialog(null, "deu erro");
		} catch (HibernateException e) {
			
			e.printStackTrace();
			JOptionPane.showMessageDialog(null, "deu erro");
		}
	}

}